package singleinstance;

public class demo
{
    public static void main(String[] args) {
        //目标：设计单例类
        A b = A.getInstance();
        A c = A.getInstance();
        System.out.println(b);
        System.out.println(b);
        System.out.println(b==c);

        System.out.println("===================");

        B b1 = B.getinstance();
        B b2 = B.getinstance();
        System.out.println(b1);
        System.out.println(b2);
        System.out.println(b1==b2);

    }
}
